<?php

namespace sffi\WechatRobotPlug\msg_attribute;

trait MsgSend
{
    protected $toRobot;
    protected $toGroup;
    protected $toFriend;
    /**
     * 变更发送到组
     * @param $data
     * @return array
     */
    abstract protected function changeToGroup(&$data):array;

    /**
     * 变更发送到好友
     * @param $to
     * @return array
     */
    abstract protected function changeToFriend(&$data):array;

    /**
     * @return mixed
     */
    public function getToRobot()
    {
        return $this->toRobot;
    }

    /**
     * @param mixed $toRobot
     */
    public function setToRobot($toRobot): self
    {
        $this->toRobot = $toRobot;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getToGroup()
    {
        return $this->toGroup;
    }

    /**
     * @param mixed $toGroup
     */
    public function setToGroup($toGroup): self
    {
        $this->toGroup = $toGroup;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getToFriend()
    {
        return $this->toFriend;
    }

    /**
     * @param mixed $toFriend
     */
    public function setToFriend($toFriend): self
    {
        $this->toFriend = $toFriend;
        return $this;
    }

    /**
     * 获取基础发送信息
     * @param $method
     * @return mixed
     */
    abstract public function getBaseSendMsg($method);

}